import javax.swing.*;

public class ShowSudoku {
	
	private static int[][] p1, p2, p3;
	
	public static void main(String[] arg){
		ISudokuSolver s = new SudokuSolver();
		s.setup(3);
		instantiatePuzzles();
		s.readInPuzzle(p1);

		SudokuGUI g = new SudokuGUI(s);

		// Setup of the frame containing the puzzle
		JFrame f = new JFrame();
		f.setSize(1000,1000);
		f.setTitle("Sudoku Solver");
		f.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
		f.getContentPane().add(g);    
		f.setVisible(true);
	}
	
	private static void instantiatePuzzles() {
		p1 = new int[9][9];
		p2 = new int[9][9];
		p3 = new int[9][9];
		for (int i = 0; i < 9; i++)
			for (int j = 0; j < 9; j++)
				p1[i][j] = p2[i][j] = p3[i][j] = 0;
		p1[0][0]=2;
		p1[1][1]=5;
		p1[1][4]=9;
		p1[1][6]=2;
		p1[2][1]=3;
		p1[2][2]=9;
		p1[2][3]=5;
		p1[2][5]=2;
		p1[2][7]=1;
		p1[3][2]=4;
		p1[3][3]=7;
		p1[3][5]=6;
		p1[3][7]=2;
		p1[3][8]=8;
		p1[4][4]=2;
		p1[5][0]=6;
		p1[5][1]=9;
		p1[5][3]=4;
		p1[5][5]=8;
		p1[5][6]=3;
		p1[6][1]=8;
		p1[6][3]=6;
		p1[6][5]=1;
		p1[6][6]=7;
		p1[6][7]=5;
		p1[7][2]=1;
		p1[7][4]=7;
		p1[7][7]=3;
		p1[8][8]=6;
	}
}

